package com.kayang.webapi.tool;

import java.util.Random;

public class RandomUtil {
	/**
	 * 生成随机字符串
	 * @param length
	 * @return
	 */
	private static String allchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

	public static String getKey() {
		StringBuffer stringBuffer = new StringBuffer();
		for (int i = 0; i < 32; i++) {
			Random random = new Random();    
			int index = random.nextInt(allchars.length());
			stringBuffer.append(allchars.charAt(index));
		}
		return stringBuffer.toString();
	}

}
